<!--
 * @Author: 汪军 624473119@qq.com
 * @Date: 2023-10-11 09:05:40
 * @LastEditors: 汪军 624473119@qq.com
 * @LastEditTime: 2023-10-11 17:50:04
 * @FilePath: \ekee-web\src\components\pagination.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <el-pagination
      :current-page="currentPage"
      :page-size="pageSize"
      :total="totalList"
      :pager-count="6"
      background
      layout="prev, pager, next"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>


<script setup>
import { onMounted, ref } from "vue";
import { defineEmits } from "vue";

const props = defineProps({
    totalList: {
      type: Number,
      default: 0,
    },
    page:{
      type: Number,
      default: 0,
    }
  });


const count = ref(0);

const pageSize = ref(10);
const currentPage = ref(1); //默认页面
// 使用defineEmits创建名称，接受一个数组
const emit = defineEmits(["handleCurrentChange"]);

const handleSizeChange = (val) => {
  console.log(`${val} items per page`);
};
// 翻页 当前页数
const handleCurrentChange = (val) => {
  // let param = {
  //   currenPpage: val,
  // };
  console.log("val11", val);
  currentPage.value = val;
  emit("handleCurrentChange", currentPage.value);
};
</script>



<style scoped>
.read-the-docs {
  color: #888;
}
</style>
